<html>
<head><meta charset="utf-8"><title>binary_heap From&lt;Vec&gt; · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/binary_heap.20From.3CVec.3E.html">binary_heap From&lt;Vec&gt;</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="137114225"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/binary_heap%20From%3CVec%3E/near/137114225" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/binary_heap.20From.3CVec.3E.html#137114225">(Nov 03 2018 at 13:55)</a>:</h4>
<p>Do I need to sort a Vec before building a BinaryHeap from it ? Depending on whether I sort it or not, I appear to be getting two different BinaryHeaps.</p>



<a name="137128030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/binary_heap%20From%3CVec%3E/near/137128030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/binary_heap.20From.3CVec.3E.html#137128030">(Nov 03 2018 at 20:45)</a>:</h4>
<p>what do you mean by "different BinaryHeaps"? there are many different ways to put the same set of elements into a binary heap, and all of them work the same with the heap interface (pop() removes elements in order), but e.g. iteration and Debug printing is arbitrary either way</p>



<a name="137128333"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/binary_heap%20From%3CVec%3E/near/137128333" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> gnzlbg <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/binary_heap.20From.3CVec.3E.html#137128333">(Nov 03 2018 at 20:55)</a>:</h4>
<blockquote>
<p>iteration and Debug printing is arbitrary either way</p>
</blockquote>
<p>I was comparing them with debug printing -.-</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>